package com.dz.risk.interceptor;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author baohan
 * @className WebMvcConfi
 * @description TODO
 * @date 2021/7/2 16:06
 */
@Configuration
public class WebMvcConfi  implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        //注册TestInterceptor拦截器
        InterceptorRegistration registration = registry.addInterceptor(new PermissionInterceptor());
        //所有路径都被拦截
        registration.addPathPatterns("/dz-ftsp/stest/**");
        //添加不拦截路径
//        registration.excludePathPatterns(
//                //登录
//                "登陆路径",
//                //html静态资源
//                "/**/*.html",
//                //js静态资源
//                "/**/*.js",
//                //css静态资源
//                "/**/*.css",
//                "/**/*.woff",
//                "/**/*.ttf"
//        );
    }
}
